package io.renren.modules.customer.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.customer.entity.BatchApplicationEntity;
import io.renren.modules.customer.entity.CustomerEntity;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author Sean
 * @email seanla@qq.com
 * @date 2020-03-17 16:36:45
 */
public interface BatchApplicationService extends IService<BatchApplicationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 提交批量进件
     * @param batchNumbers 手机号与批次号的映射关系
     * @param customerEntities 用户信息
     * @param currentUserId 当前用户id
     * @return
     */
    List<BatchApplicationEntity> submitToApply(Map<String, String> batchNumbers, List<CustomerEntity> customerEntities, Long currentUserId);

    /**
     * 获得进件信息
     * @param batchNumber
     * @param mobilePhone
     * @return
     */
    BatchApplicationEntity getByBatchNumberAndMobilePhone(String batchNumber, String mobilePhone);

    /**
     * @param batchSize 批次大小
     * @return
     */
    List<BatchApplicationEntity> getPendingRequestEntities4Apply(int batchSize);

    /**
     * @param batchSize 批次大小
     * @param maxRetryCount 最大尝试次数
     * @return
     */
    List<BatchApplicationEntity> getFailRequestEntities4Apply(int batchSize, int maxRetryCount);
}

